<?php
/**
 * @package SQL
 * @subpackage Query
 *
 */
class Lead_Sql_Query_Where_Condition
{
	private $_field;
	private $_operator;
	private $_value;
	
	private $_isQuoted;
		
	
	public function __construct(Lead_Sql_Query_Field $field, Lead_Sql_Query_Operator $operator, $value, $isQuoted = false)
	{
		$this->_field = $field;
		$this->_operator = $operator;
		$this->_value = $value;
		
		$this->_isQuoted = $isQuoted;
	}
	
	
	public function getSQL()
	{
		$value = ($this->_isQuoted) ? "'{$this->_value}'" : $this->_value;
		$phrase = "{$this->_field->getSQLName()} {$this->_operator->getSQL($value)}";
		return $phrase;
	}

	
}
?>